package com.lm.survey.model;

public class QuestionItem {
    int id;
    int groupId;
    String content;
    String help;
    int totalScore;
    int commentRequired;
    int required;
    int style;
    int type;
    int seq;
    String code = null;

    String answer;

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    private ChoiceTemplate template = new ChoiceTemplate();

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getStyle() {
        return style;
    }

    public void setStyle(int style) {
        this.style = style;
    }

    public int getCommentRequired() {
        return commentRequired;
    }

    public void setCommentRequired(int commentRequired) {
        this.commentRequired = commentRequired;
    }

    public int getRequired() {
        return required;
    }

    public void setRequired(int required) {
        this.required = required;
    }

    public ChoiceTemplate getTemplate() {
        return template;
    }

    public void setTemplate(ChoiceTemplate template) {
        this.template = template;
    }

    public int getSeq() {
        return seq;
    }

    public void setSeq(int seq) {
        this.seq = seq;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getHelp() {
        return help;
    }

    public void setHelp(String help) {
        this.help = help;
    }

    public int getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(int totalScore) {
        this.totalScore = totalScore;
    }
    public String toString(){
        return this.seq+ "."+this.content;
    }

    public int compare(QuestionItem i) {
        if (this.seq < i.seq)
            return -1;
        else if (this.seq == i.seq) {
            return this.id - i.id;
        } else {
            return 1;
        }
    }

}
